const express = require('express')
const app = express()
const passport = require("passport")


//解析post数据
app.use(express.json())
app.use(express.urlencoded({ extended: false }))

//初始化passport
app.use(passport.initialize());
require("./config/passport")(passport)

//引入user.js
const user = require("./router/api/users")
app.use("/api/user", user)

//引入admin.js
const profileRouter = require("./router/api/profile")
app.use("/api/profile", profileRouter)

//引入data.js
const dataRouter = require("./router/total/data")
app.use("/total/data", dataRouter)

app.listen(5100, () => {
  console.log('express is running at http://127.0.0.1:5100');
})